<template>
  <div>
    <ul>
      <li>
        <router-link to="/contacts/All_contacts">All_contacts</router-link>
      </li>
      <li><router-link to="/contacts/Alice">Alice</router-link></li>
      <li><router-link to="/contacts/Bob">Bob</router-link></li>
    </ul>
    <button @click="isShow">随机显示</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ["/contacts/All_contacts", "/contacts/Alice", "/contacts/Bob"],
    };
  },
  methods: {
    isShow() {
      const random = Math.floor(Math.random() * this.arr.length);
      console.log(this.arr[random]);
      this.$router.push({
        path: this.arr[random],
      })
    },
  },
};
</script>

<style></style>
